home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c
- Subject: Re: hex to dec function?
- Date: 27 Feb 1996 03:31:26 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Feb26203126@qcd.lanl.gov>
- References: <4gdh1b$bg@mailhost.mwmicro.com>
- <larry_kearney-2302960806460001@amaryllisp1.appsig.com>
- <4gsbq6$2dce@info4.rus.uni-stuttgart.de>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: schweikh@itosun.ito.uni-stuttgart.de's message of 26 Feb 1996 13:15:50 GMT
-
- In article <4gsbq6$2dce@info4.rus.uni-stuttgart.de>
- schweikh@itosun.ito.uni-stuttgart.de (Jens Schweikhardt) writes:
- <snip>
- JS: > sscanf( string_buffer, "%x", int_value );
- JS: > sscanf( string_buffer, "%lx", long_int_value );
- JS:
- JS: At the risk of stating the obvious, my workstation will probably
- JS: dump core because sscanf wants _pointers_ to int_value and
- JS: long_int_value, i.e. &int_value.
-
- Actually, &unsigned_int_value is required for %x format. Sending in a
- pointer to int results in undefined behaviour. (However, this should
- not matter unless the compiler explicitly checks for it: such checks
- are allowed, however).
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-